import 'package:taonile/generated/json/base/json_convert_content.dart';
import 'package:taonile/entity/pay_methods_entity.dart';

PayMethodsEntity $PayMethodsEntityFromJson(Map<String, dynamic> json) {
	final PayMethodsEntity payMethodsEntity = PayMethodsEntity();
	final int? code = jsonConvert.convert<int>(json['code']);
	if (code != null) {
		payMethodsEntity.code = code;
	}
	final String? msg = jsonConvert.convert<String>(json['msg']);
	if (msg != null) {
		payMethodsEntity.msg = msg;
	}
	final List<PayMethodsData>? data = jsonConvert.convertListNotNull<PayMethodsData>(json['data']);
	if (data != null) {
		payMethodsEntity.data = data;
	}
	return payMethodsEntity;
}

Map<String, dynamic> $PayMethodsEntityToJson(PayMethodsEntity entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['code'] = entity.code;
	data['msg'] = entity.msg;
	data['data'] =  entity.data.map((v) => v.toJson()).toList();
	return data;
}

PayMethodsData $PayMethodsDataFromJson(Map<String, dynamic> json) {
	final PayMethodsData payMethodsData = PayMethodsData();
	final String? payName = jsonConvert.convert<String>(json['pay_name']);
	if (payName != null) {
		payMethodsData.payName = payName;
	}
	final String? payChannel = jsonConvert.convert<String>(json['pay_channel']);
	if (payChannel != null) {
		payMethodsData.payChannel = payChannel;
	}
	final String? icon = jsonConvert.convert<String>(json['icon']);
	if (icon != null) {
		payMethodsData.icon = icon;
	}
	final String? pay = jsonConvert.convert<String>(json['pay']);
	if (pay != null) {
		payMethodsData.pay = pay;
	}
	return payMethodsData;
}

Map<String, dynamic> $PayMethodsDataToJson(PayMethodsData entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['pay_name'] = entity.payName;
	data['pay_channel'] = entity.payChannel;
	data['icon'] = entity.icon;
	data['pay'] = entity.pay;
	return data;
}